This post lists resources to download JDBC drivers for common databases, for your reference in database programming with Java.

You know, in order for Java applications working with a database engine via Java Database Connectivity (JDBC), an appropriate JDBC driver library is required to be available in the application’s classpath. A JDBC driver library consists of Java classes which implement low-level communication with the database engine. It talks with Java applications via JDBC API and usually bundled as a JAR or ZIP file.

For your reference and convenience, this article provides a summary of JDBC driver download for common databases including MySQL, SQL Server, Oracle, PostgreSQL, Apache Derby (Java DB), SQLite, H2 and Microsoft Access. If you use Maven, see the Maven dependencies for those JDBC drivers below.

In the table below, click on the download link corresponding to the database you want to download its JDBC driver JAR file:

 

JDBC Driver Download:

 

Database

JDBC Driver Provider

JAR file name

Download

 

MySQL

 

 

Oracle Corporation

 

mysql-connector-java-VERSION.jar

 

Download JDBC Driver for MySQL

 

SQL Server

 

 

Microsoft Corporation

 

sqljdbc41.jar, sqljdbc42.jar

 

Download JDBC Driver for SQL Server

 

Oracle

 

Oracle Corporation

 

ojdbc6.jar, ojdbc7.jar, ojdbc8.jar

 

Download JDBC Driver for Oracle (login required)

 

 

PostgreSQL

 

 

The PostgreSQL Global Development Group

 

postgresql-VERSION.jar

 

Download JDBC Driver for PostgreSQL

 

Apache Derby

 

 

Apache Software Foundation

 

derby.jar, derbyclient.jar

 

Download JDBC Driver for Apache Derby

 

SQLite

 

Xerial.org

 

sqlite-jdbc-VERSION.jar

 

Download JDBC Driver for SQLite

 

 

H2

 

 

h2database.com

 

h2-VERSION.jar

 

Download JDBC Driver for H2 Database

 

Microsoft Access

 

UCanAccess.com

 

ucanaccess-VERSION.jar

 

Download JDBC Driver for Microsoft Access

 

 

NOTES:

  • Some drivers come as JAR files (Oracle, PostgreSQL), so you can add the JAR files directly to your application’s classpath.
  • Some drivers come as zipped bundles (MySQL, SQL Server), so you have to extract the bundles and copy the appropriate JAR file (as specified in the above table) to your application’s classpath.
  • There is a distribution of Apache Derby comes with JDK 7 called Java DB. So if you are using JDK 7, you can use the jar files directly from JDK_HOME\db\lib directory without downloading Apache Derby. However, Java DB is removed from JDK since Java 8.
 

Maven Dependencies for JDBC Drivers

If your Java project uses Maven, simply add the following dependency in the pom.xmlfile.

Maven Dependency for MySQL JDBC Driver:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>
 

Maven Dependency for Microsoft JDBC driver for SQL Server:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>8.2.1.jre11</version>
</dependency>


 

Maven Dependency for Oracle JDBC Driver:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>d:/Path/To/Oracle/ojdbc8-full/ojdbc8.jar</systemPath>
</dependency>
NOTE: Due to Oracle's license restriction, you must manually download Oracle JDBC driver and use system dependency like that.

 

Maven Dependency for PostgreSQL JDBC Driver:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.2.jre7</version>
</dependency>
 

Maven Dependency for SQLite JDBC Driver:

<dependency>
    <groupId>org.xerial</groupId>
    <artifactId>sqlite-jdbc</artifactId>
    <version>3.21.0.1</version>
</dependency>
 

Maven Dependency for Apache Derby JDBC Driver:

<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derby</artifactId>
    <version>10.14.2.0</version>
</dependency>
 

Maven Dependency for H2 JDBC Driver:

<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <version>2.1.210</version>
</dependency>
  

Maven Dependency for Microsoft Access JDBC Driver:

<dependency>
    <groupId>net.sf.ucanaccess</groupId>
    <artifactId>ucanaccess</artifactId>
    <version>4.0.4</version>
</dependency>
NOTE: The versions of the dependencies listed above may not be up to date. You can search on Maven Central Repository for the latest versions.

 

Related JDBC Tutorials:


About the Author:

is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.



Add comment

   


Comments 

#6DirectDeals2022-09-20 02:26
Thank You for the tips. I loved it. These are quite actionable and will help me a lot.
Quote
#5Juan David2021-05-03 20:36
Hola excelente repositorio de URL para las diferentes opciones para SQL que tenemos en JAVA.

Muchas Gracias.
Quote
#4Wiseman2019-08-15 16:56
Hi, I Need help with my netbeans, with the derby database part, start server, stop server and create database are disabled, i don't know how it just happened so it wont allow me to continue wit h work
Quote
#3shehab fozy ahmed2016-07-27 08:17
I want to get jdbc driver
Quote
#2morteza2016-03-20 07:22
hello
oracle site for we is blocked .... ( i from iran) ...
please send me oracle JDBC driver library to my email :

tnx
Quote